home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 2271 < prev    next >
Encoding:
Text File  |  1996-08-05  |  3.1 KB  |  87 lines

  1. Path: news.polymtl.ca!cormier
  2. From: cormier@step.polymtl.ca (Mario Cormier)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: HELP WITH C PROGRAMMING!!!
  5. Date: 20 Jan 1996 03:40:46 GMT
  6. Organization: STEP
  7. Message-ID: <4dpo7u$aho@service.polymtl.ca>
  8. References: <kelvin-1901961812070001@user12.infohouse.com>
  9. NNTP-Posting-Host: step.polymtl.ca
  10. X-Newsreader: TIN [version 1.2 PL2]
  11.  
  12. Kelvin Eng (kelvin@infohouse.com) wrote:
  13. : I have a few C-Programming Questions that need to be answer, if you can
  14. : answer or or even one, it would be of great help and would be greatly
  15. : appreciated.
  16.  
  17. : 1) Write a program which prompts the user for integer values for a, b, c,
  18. : and d and outputs a table of values of the following polynomial: an3 + bn2
  19. : + cn + d = f(n) for values of n from O to 10.
  20.  
  21. : Number 2 is referring to the program C-Robots
  22.  
  23. : 2) Write a robot which immediately travels to the center coordinates of
  24. : the screen, stays there and fires continuously in a clockwise pattern
  25. : exactly 30 shots per each rotation.
  26.  
  27. : 3) Write a function which accepts three arguments and evaluates the
  28. : discriminant of a
  29. : quadratic equation: b(squared)-4ac. The function returns 1 if the
  30. : discriminant is greater than zero, -1 if less than zero and zero
  31. : otherwise.
  32.  
  33. : 4) Write a function which accepts 2 integer arguments and returns the sum
  34. : of the squares of all the integers between those arguments (and including
  35. : them.)
  36.  
  37. : 5) Use a calculator, to write the output for this fragment:
  38.  
  39. : main()
  40.  
  41. : {
  42. :                   float x = 79.1;
  43.  
  44. :                   num= 1.0;
  45.  
  46. :                   while(abs_val(num*num - x) > = .0000001)
  47.  
  48. :                               {
  49. :                                        num = (x/num + num) / 2;
  50. :                                        printf(" %f\n",num);
  51. :                               }
  52. : }
  53.  
  54. : 6) Write a function which prints out a list of Pythagorean triples in
  55. : which the legs differ by 1.
  56. : The function checks whether x(squared) + (x+ 1)(squared) is a perfect
  57. : square as x increases from 3 to the limit of the computer:
  58.  
  59. : 3           4                 5
  60.  
  61. : 20          21             29
  62.  
  63. : etc.
  64.  
  65. : 7) Write a program containing a function called "convert" which accepts a
  66. : single float
  67. : argument (░F) and returns its centigrade equivalent (nearest hundredth), using: 
  68. : C░ = 5 (F░-32)  / 9
  69. : The program must prompt the user to enter a temperature.
  70.  
  71. Sorry, I am not into doing homework for other people.  I have enough work
  72. with mine already...
  73.  
  74. : Thanks in any help HELP
  75. : Please email me at: kelvin@infohouse.com with any answers.
  76. : I really appreciate it.
  77.  
  78. --
  79. ============================================================================
  80. ==          OS/2 Development          ==  Mario Cormier                   ==
  81. ==      ####   ####    ##  ####       ==  Computer Engineering            ==
  82. ==     ##  ## ##      ##  ##  ##      ==  Ecole Polytechnique de Montreal == 
  83. ==     ##  ##  ####   ##     ##       ==                                  ==
  84. ==     ##  ##     ## ##    ##         ==  cormier@info.polymtl.ca         ==
  85. ==      ####   ####  ##   ######      ==  cormier@step.polymtl.ca         ==
  86. ============================================================================
  87.